<template>
    <baseModel ref="base" spellcheck="false" @touchmove.prevent v-if="!mobile">
        <router-view v-slot="{ Component }">
            <transition name="animate__animated " enter-active-class="animate__fadeInLeft animate__fast"
                leave-active-class="animate__fadeOutRight animate__faster" mode="out-in">
                <keep-alive ref="keepaliveRef">
                    <component :is="Component" :key="$route.fullPath" />
                </keep-alive>
            </transition>
        </router-view>
    </baseModel>
    <div v-else class="mob-info">
        <div>请使用电脑端查看maven仓库信息</div>
        <div style="padding-top: 30px;">
            <a href="https://dansj.cn">进入个人博客</a>
        </div>
    </div>
</template>

<script setup>
import { useMouseType } from "@usehook"
import { mobile } from "@/utils/tools"

//body添加el-popup-parent--hidden,避免windows下dialog出现body偏移
document.body.classList.add('el-popup-parent--hidden')

useMouseType(() => { return { showMouse: true, showPaoPao: false } })

const forbidRightClick = () => {
    document.oncontextmenu = () => {
        return false
    }
}

const forbidDragstart = () => {
    document.ondragstart = () => {
        return false
    }
}

onMounted(() => {
    forbidRightClick()
    forbidDragstart()
})
</script>

<style>
.mob-info {
    width: 100vw;
    height: 50vh;
    position: relative;
    text-align: center;
    top: 25vh;
}

a:link,
a:visited {
    color: #4d76cf;
}
</style>